package com.hopital5.zhangyz.controller;

import com.hopital5.zhangyz.service.ActivityItemService;
import com.hopital5.zhangyz.vo.request.ActivityItemVoRequest;
import com.hopital5.zhangyz.vo.response.ActivityItemVoResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/activityItem")
public class ActivityItemController extends BaseController {
    @Autowired
    ActivityItemService activityItemService;

    @PutMapping
    public ActivityItemVoResponse insert(@RequestBody ActivityItemVoRequest activityItemVoRequest) {
        return ActivityItemVoResponse.build(activityItemService.save(activityItemVoRequest));
    }

    @PostMapping
    public ActivityItemVoResponse update(@RequestBody ActivityItemVoRequest activityItemVoRequest) {
        return ActivityItemVoResponse.build(activityItemService.update(activityItemVoRequest));
    }
}
